﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AlphaSolutionsGP.Demo_classes
{
    class AssesmentDemo
    {
        Assesment a1;
        Assesment a2;
        private string passorfail;
        private int _pass;
        private int _fail;


        public AssesmentDemo()
        {
            if ((testAssessmentNoArgConstructor()) == false)
            {
                _fail++;
            }
            else
            {
                _pass++;
            }
            if ((testGradeArgConstructor()) == false)
            {
                _fail++;
            }
            else
            {
                _pass++;
            }
            if ((testCreateAssessment()) == false)
            {
                _fail++;
            }
            else
            {
                _pass++;
            }
            if ((testAmmendAssessment()) == false)
            {
                _fail++;
            }
            else
            {
                _pass++;
            }
            if ((testRemoveAssesment()) == false)
            {
                _fail++;
            }
            else
            {
                _pass++;
            }
        }


        bool testAssessmentNoArgConstructor()
        {
            bool success = false;
            try
            {
                a1 = new Assesment();
                success = true;
            }
            catch (Exception e)
            {
                success = false;
            }
            return success;
        }


        bool testGradeArgConstructor()
        {
            bool success = false;
            try
            {
                a2 = new  Assesment(28,"C1003", "inactive", "1992-01-10", "1993-09-10",3,"exam","This is a string");
                success = true;
            }
            catch (Exception e)
            {
                success = false;
            }
            return success;
        }
        bool testCreateAssessment()
        {
            bool success = false;
            try
            {
                a2.createAssessment();
                success = true;
            }
            catch (Exception e)
            {
                success = false;
            }
            return success;
        }
        bool testRemoveAssesment()
        {
            bool success = false;
            try
            {
                a2.removeAssessment();
                success = true;
            }
            catch (Exception e)
            {
                success = false;
            }
            return success;
        }
        bool testAmmendAssessment()
        {
            bool success = false;
            try
            {
                a1.Desc = "Ammended";
                a1.amendAssessment();
                success = true;
            }
            catch (Exception e)
            {
                success = false;
            }
            return success;
        }
        public int Fail
        {
            get { return _fail; }
            set { _fail = value; }
        }

        public int Pass
        {
            get { return _pass; }
            set { _pass = value; }
        }

    }
}
